package com.xbongbong.saas.model;

import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.template.pojo.EnablePojo;

import java.util.List;

/**
 * @author 吴峰
 * @date 2022/01/18 15:34
 */
public interface FormTemplateModel {

    /**
     * Description: 获取启用的form表单(加了工单的特殊处理，PaasFormModel还有一个那是获取除工单的)
     * @param corpid
     * @param loginUser
     * @param businessType 业务类型
     * @param appId 应用id
     * @param distributorMark
     * @return java.util.List<com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt>
     * @author 魏荣杰
     * @date 2019/5/16 14:13
     * @since v1.0
     * @throws XbbException
     */
    List<PaasFormEntityExt> getEnableFormList(String corpid, UserVO loginUser, Integer businessType, Long appId, Integer distributorMark) throws XbbException;

    /**
     * 获取各个业务权限内的启用模板
     * @param corpid
     * @param form
     * @param subBusinessType
     * @param loginUser
     * @return java.util.List<com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt>
     * @author 吴峰
     * @date 2022/1/18 17:06
     * @throws XbbException
     */
    List<PaasFormEntityExt> getSaasFormList(String corpid, PaasFormEntityExt form,  Integer subBusinessType, UserVO loginUser) throws XbbException;


    /**
     * 获取各个业务权限内的启用模板
     * @param corpid
     * @param form
     * @param subBusinessType
     * @param loginUser
     * @return java.util.List<com.xbongbong.pro.template.pojo.EnablePojo>
     * @author 吴峰
     * @date 2022/1/18 17:15
     * @throws XbbException
     */
    List<EnablePojo> getSaasTemplateList(String corpid, PaasFormEntityExt form,  Integer subBusinessType, UserVO loginUser) throws XbbException;



    /**
     * 设置模板
     * @param corpid
     * @param form
     * @param subBusinessType
     * @param loginUser
     * @param explainList
     * @return void
     * @author 吴峰
     * @date 2022/6/14 14:58
     * @throws XbbException
     */
    void setTemplate(String corpid, PaasFormEntityExt form,  Integer subBusinessType, UserVO loginUser, List<FieldAttrEntity> explainList, Integer editable) throws XbbException;
}
